home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / prgs / ShellUtils / diff.b < prev    next >
Text File  |  1996-09-10  |  503b  |  38 lines

  1. '..show differences between two files.
  2.  
  3. deflng a-z
  4.  
  5. if argcount<>2 then 
  6.   print "usage: ";arg$(0);" <file1> <file2>"
  7.   stop
  8. end if
  9.  
  10. open "I",#1,arg$(1)
  11. open "I",#2,arg$(2)
  12.  
  13. count=0
  14.  
  15. on break goto _exit
  16. break on
  17.  
  18. while not eof(1) and not eof(2)
  19.   line input #1,x$  
  20.   line input #2,y$
  21.   if x$<>y$ then 
  22.     print "1: ";x$
  23.     print "2: ";y$
  24.     ++count
  25.   end if   
  26. wend
  27.  
  28. _exit:
  29.   print
  30.  
  31.   if count=1 then 
  32.     print " 1 difference found."
  33.   else
  34.     print count;"differences found."
  35.   end if
  36.  
  37. close 1,2
  38.